//For fun
$(document).ready(function(){
	
	$("#showButton").click(function(){
		$("tr").each(function(){
			$(this).show();
		});
		$("td").each(function(){
			$(this).show();
		});
	});
	
	$("td").click(function(){
		var selectIndex = $("#selectIndex").val();
		var colIndex = $(this).parent().children().index($(this));
		var rowIndex = $(this).parent().parent().children().index($(this).parent());
		if(selectIndex == "col")
		{
			window.alert("col: " + (colIndex + 1) + "  will be deleted!");
			$("td:nth-child(" + (colIndex + 1) + ")").hide();
		}
		else if(selectIndex == "row")
		{
			window.alert("row: " + (rowIndex + 1) + "  will be deleted!");
			$("tr:eq(" + rowIndex + ")").hide();
		}
		else
		{
			window.alert("row: " + (rowIndex + 1) + ", col: " + (colIndex + 1) + "  will be deleted!");
			$(this).hide();
		}
	});
});